package com.bemes.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileReaderWrapper {
	
	File m_xmlFile;
	
	public FileReaderWrapper(String xmlFile)
	{
		m_xmlFile = new File(xmlFile);
	}
	
	public String xmlFileToStr()
	{		
		String retBuff = "";	
		char[] cbuf;
		int dataLen = (int) m_xmlFile.length();		
		cbuf = new char[dataLen];
		FileReader fr = null;
			
		try {
			fr = new FileReader(m_xmlFile);
			int readLen = fr.read(cbuf, 0, dataLen);
				
			if(readLen > 0)
		    {
				retBuff = String.valueOf(cbuf);
		    }
				
		} catch (FileNotFoundException e) {
		} catch (IOException e) {
		} finally{
			if(fr != null){
				try{
					fr.close();
				}catch(Exception e){}
			}
		}
		
		return retBuff;
	}
}
